#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	long long int time;
	scanf("%lld",&time);
	long long int time_s = time % (60 * 1000 * 60 * 24);
	int hour = time_s / (1000 * 60 * 60);
	int minute = (time_s % (1000* 60 * 60)) / (60 * 1000);
	int sec = time_s % (60 * 1000) / 1000;
	printf("%02d:%02d:%02d", hour, minute, sec);
	return 0;
}